<!DOCTYPE html>
<html lang="en">

<head>
 <meta charset="UTF-8">
 <meta name="viewport"
  content="width=device-width, initial-scale=1.0, minimum-scale=1,maximum-scale=1,user-scalable=no">
 <meta http-equiv="X-UA-Compatible" content="ie=edge">
 <title data-ch="恐龙探险" data-en="Dinosaur Adventure" class="document_title">恐龙探险</title>
 <script src="js/jquery-3.3.1.min.js"></script>
 <script src="js/common.js"></script>
 <script src="js/layer.js"></script>
 <script src="js/rem.js"></script>
 <script type="text/javascript">
  isLogin();
 </script>
 <link rel="stylesheet" href="js/need/layer.css">
 <link rel="stylesheet" href="css/common.css">
 <link rel="stylesheet" href="css/index.css">
</head>

<body>
 <!--头部-->
 <div class="jui_top_bar">
  <a class="jui_top_left" href="javascript:history.back(-1)"><img src="icons/back.png"></a>
  <div class="jui_top_middle font_weight" data-ch="银行资料" data-en="Bank details">银行资料</div>
  <a href="bank_add.html" class="jui_top_right f30 font_weight">添加</a>
 </div>
 <!-- 头部end -->
 <!-- 主体部分开始 -->
 <div class="jui_main bank_info_details col_fff padding_032" style="padding-top:1rem;">
  <!-- 没有银行卡数据时显示 -->
  
  <!-- 有数据时显示 -->
  
  
  
 </div>
 <!-- 主体部分end -->

 <script>
  // 页面加载时, 如果有银行卡信息, 头部右侧文字为"更改",内容展示银行列表
  // 否则, 头部右侧文字为"添加", 内容为"请添加银行资料"
  $(document).ready(function(){
   var isBank = localStorage.getItem("isBank");
   var language_type = localStorage.getItem("language_type");
   var details = ''
   if(isBank == 0){
    $(".jui_top_right").html(language_type == 1 ? '添加' : 'Add')
    details = `<div class="padding_032 col_fff bank_list_null f32 border_radius02" data-ch="请点击右上角添加银行资料"
     data-en="Please fill in bank details">请点击右上角添加银行资料</div>`
   } else{
    $(".jui_top_right").html(language_type == 1 ? '更改' : 'Change')
    details = `<div class="bank_list latout_mask border_radius05 padding_032 flex_be">
     <div class="padding_032">
      <div class="text_left">
       <span class="col_fff" data-ch="开户银行 :" data-en="Bank name:">开户银行 : </span>
       <span class="bank_info1"></span>
      </div>
      <div class="text_left">
       <span class="col_fff" data-ch="银行户口名称 :" data-en="Bank account holder name:">银行户口名称 :</span class="col_fff">
       <span class="bank_info2"></span>
      </div>
      <div class="text_left">
       <span class="col_fff" data-ch="银行账户 :" data-en="Bank account number: ">银行账户 :</span class="col_fff">
       <span class="bank_info3" class="col_fff"></span class="bank_info1">
      </div>
      <div class="text_left">
       <span class="col_fff" data-ch="银行开户处 :" data-en="Bank branch: ">银行开户处 :</span class="col_fff">
       <span class="bank_info4"></span>
      </div>
     </div>
    </div>`
   }
   $(".bank_info_details").html(details)
   var data = {
    uid: localStorage.getItem("u_id"),
    token: localStorage.getItem("token"),
    language_type: localStorage.getItem("language_type"),
   }
   $.ajax({
    type: 'post',
    url: baseURL + '/index.php?m=user&c=config_setup',
    data: data,
    success: function success(data) {
     data = JSON.parse(data);
     is_login(data);
     if (data.code == 1) {
      $(".bank_info1").html(data.user.m_shou_bank_kai);
      $(".bank_info2").html(data.user.m_shou_bank_name);
      $(".bank_info3").html(data.user.m_shou_account);
      $(".bank_info4").html(data.user.m_shou_bank);
     } else {
     }
    }
   })


   language()
   documentName()
   // 删除银行卡
   $(".bank_list_del").click(function(){
    $(this).parent().addClass("display_none");
   })
  })
 </script>
</body>

</html>